package com.shopcart.service.impl;

import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shopcart.domain.OrderDetail;
import com.shopcart.repository.OrderDetailRepository;
import com.shopcart.service.OrderDetailService;

@Service
@Transactional
public class OrderDetailServiceImpl implements OrderDetailService {

	@SuppressWarnings("unused")
	private static final Logger LOGGER = LoggerFactory
			.getLogger(OrderDetailServiceImpl.class);
	
	@Autowired
	JdbcTemplate jdbcTemplate;
	
	@Autowired
	private OrderDetailRepository orderDetailRepository;

	@Override
	public Collection<OrderDetail> selectByOrderId(String orderId) {
		// TODO Auto-generated method stub
		return orderDetailRepository.findByOrderId(orderId, new Sort(Direction.DESC, "id"));
	}

 
	 

	
}
